package hw_7_24;

import java.util.Scanner;

public class Math_Demo1 {
    public static void main(String[] args) {
        System.out.println("我行我素购物管理系统->幸运抽奖");
        int randomNum = (int)(Math.random() * 10);
        System.out.println(randomNum);
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("请输入4位会员号：");
            int memberID = sc.nextInt();
            int hundredsDigit = (memberID / 100) % 10;
            if (randomNum == hundredsDigit){
                System.out.println(memberID + "是幸运客户，获得精美MP3一个！");
            } else {
                System.out.println("谢谢参与！");
            }
        }
    }
}
